home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Camelot / Camelot 078 (1990-06)(Swedish User Group of Amiga)(SE)(PD)[WB].zip / Camelot 078 (1990-06)(Swedish User Group of Amiga)(SE)(PD)[WB].adf / MSH / doc / dev.man < prev    next >
Text File  |  1990-06-17  |  11KB  |  265 lines

  1.  
  2.      messydisk.device()    Amiga Programmer's Manual     messydisk.device()
  3.  
  4.  
  5.  
  6.      ›1mSYNOPSYS 
  7.           ›0m#include <exec/io.h>
  8.           #include <devices/trackdisk.h>
  9.           #include <dev.h>
  10.  
  11.           OpenDevice("messydisk.device", Unit, IOExtTD, Flags);
  12.           BeginIO(IOExtTD);
  13.           CloseDevice(IOExtTD);
  14.  
  15.      ›1mUSAGE 
  16.           ›0mMessydisk.device  can  be  used instead of trackdisk.device.
  17.           All current trackdisk.device commands are  supported.    The
  18.           only  functional difference is the format of the disk, which
  19.           is compatible with messydos systems.  
  20.  
  21.      ›1mCOMMANDS 
  22.           ›0mSupported commands are: 
  23.  
  24.           = CMD_INVALID     = CMD_RESET       * CMD_READ
  25.           * CMD_WRITE       * CMD_UPDATE      = CMD_CLEAR
  26.           = CMD_STOP        = CMD_START       = CMD_FLUSH
  27.             TD_MOTOR        = TD_SEEK         * TD_FORMAT
  28.             TD_REMOVE         TD_CHANGENUM      TD_CHANGESTATE
  29.             TD_PROTSTATUS     TD_RAWREAD        TD_RAWWRITE
  30.             TD_GETDRIVETYPE   TD_GETNUMTRACKS = TD_ADDCHANGEINT
  31.           = TD_REMCHANGEINT * ETD_WRITE       * ETD_READ
  32.             ETD_MOTOR       = ETD_SEEK        * ETD_FORMAT
  33.           * ETD_UPDATE      = ETD_CLEAR         ETD_RAWREAD
  34.             ETD_RAWWRITE
  35.  
  36.           The commands marked with * are handled in its own format  by
  37.           messydisk.   The  commands  marked  with  =  are  handled by
  38.           messydisk in the same way as trackdisk supposed  is  to  do.
  39.           The  other  commands  are sent straight through to trackdisk
  40.           and are subject to all its flaws and features.  
  41.           The extended commands support the disk  change  count  only.
  42.           The  sector  label pointer (iotd_SecLabel) is ignored, since
  43.           messy formatted disks don't have any label areas.  
  44.  
  45.      ›1mOPENDEVICE FLAGS 
  46.           ›0mTDF_ALLOW_NON_3_5: Allows opening 40 track drives.  Ignored,
  47.           since it is the default behaviour which cannot be disabled.  
  48.  
  49.      ›1mIO REQUEST FLAGS 
  50.           ›0mThe io_Flags field of an IOStdReq or IOExtTD  structure  may
  51.           contain the following flags: 
  52.  
  53.           IOF_QUICK: This flag is supported for only a few commands.  
  54.  
  55.           IOTDF_INDEXSYNC: For ETD/CMD_RAWREAD and _WRITE.  
  56.  
  57.           IOMDF_40TRACKS:  This  flag  is  for  ETD/CMD_READ,  _WRITE,
  58.           _FORMAT, and _SEEK.  If set, treat the disk as  40  cylinder
  59.           media.   If  it happens to be in an 80 cylinder drive, every
  60.           other cylinder will be skipped to use the same  cylinders  a
  61.           40-cylinder drive  would.    Normally  you set or clear this
  62.           flag once at the time you read the bootblock and examine its
  63.  
  64.  
  65.      Rhialto, KosmoSoft               -1-                 Version 34.8/1.30
  66.  
  67.  
  68.      messydisk.device()    Amiga Programmer's Manual     messydisk.device()
  69.  
  70.  
  71.           layout information.  It is guaranteed that  messydisk  won't
  72.           change this  flag.    IOMDF_40TRACKS  is  not  supported for
  73.           ETD/TD_RAWREAD and _RAWWRITE, since these are considered  to
  74.           be  "diagnostic" functions and therefore should be as raw as
  75.           possible.  
  76.  
  77.      ›1mDISK FORMAT 
  78.           ›0mThe disk format used is compatible  with  messydos  systems.
  79.           Both 40  and  80  cylinder  media  are supported.  There are
  80.           normally 9 sectors per track and two  tracks  per  cylinder.
  81.           (Outdated)  single-sided  disks  can  only  be  read  if the
  82.           driving  software  is  prepared  to  treat  them  as  normal
  83.           double-sided disks, and skip the sides that are not actually
  84.           present.  On the other hand, the number of sectors per track
  85.           may vary from 8 to 10. If the number of sectors is different
  86.           from  the  default value (9), then track 0 on side 0 must be
  87.           read first before this is recognized.  It  is  then  assumed
  88.           that  all  tracks on the entire disk have the same number of
  89.           sectors.  So, all position calculations  are  based  on  the
  90.           layout of the very first track.  
  91.  
  92.           --- Index pulse  ------------------------------------.
  93.                                                                |
  94.               40 * $4e    GAP 1A  ($9254 encoded)              |
  95.               12 * $00            ($AAAA encoded)              |
  96.                3 * $c2    SYNC    ($5224 encoded)              |
  97.                1 * $fc    index mark           ($5552)         |
  98.                                                                |
  99.               40 * $4e    GAP 1B  ($9254 encoded)              |
  100.                                                                |
  101.           --- First Sector -----------------------------.      |
  102.                                                         |      |
  103.               12 * $00    GAP 2   ($AAAA encoded)       |      |
  104.            |   3 * $a1    SYNC    ($4489 encoded)       |      |
  105.            |                                            |      |
  106.            |   1 * $fe    ID-Address Mark   -. ($5554)  |      |
  107.            |  track                          |          |      |
  108.            |  side                           |          |      |
  109.            |  sector                          > ID      |      |
  110.            |  length (0=128,1=256,2=512 etc.)|  Field   |  S   |
  111.            -> CRC 1                          |          |  e   |  T
  112.            -> CRC 2                         -'          |  c   |  r
  113.                                                          > t    > a
  114.               22 * $4e    GAP 3A  ($9254 encoded)       |  o   |  c
  115.               12 * $00    GAP 3B  ($AAAA encoded)       |  r   |  k
  116.            |   3 * $a1    SYNC    ($4489 encoded)       |      |
  117.            |                                            |      |
  118.            |   1 * $fb    DATA-Adress Mark  -. ($5545)  |      |
  119.            |  512 bytes data                  > DATA    |      |
  120.            -> CRC 1                          |  Field   |      |
  121.            -> CRC 2                         -'          |      |
  122.                                                         |      |
  123.               78 * $4e    GAP 4   ($9254 encoded)       |      |
  124.            or 40 * $4e    GAP 4   ($9254 encoded)       |      |
  125.           ----------------------------------------------'      |
  126.                                                                |
  127.  
  128.  
  129.  
  130.  
  131.      Rhialto, KosmoSoft               -2-                 Version 34.8/1.30
  132.  
  133.  
  134.      messydisk.device()    Amiga Programmer's Manual     messydisk.device()
  135.  
  136.  
  137.            ...... 8 or 9 more sectors .......                  |
  138.                                                                |
  139.               rest  $4e up to 6250 bytes       ($9254)         |
  140.           -----------------------------------------------------'
  141.  
  142.      ›1mDEVIATIONS 
  143.           ›0mThe TD_REMCHANGEINT command works.  (It doesn't with the 1.2
  144.           or 1.3 trackdisk.device).  
  145.  
  146.           The   messydisk   Unit   structure   does   not   look  like
  147.           TDU_PublicUnit at all.  
  148.  
  149.           In some situations, error returns may be different  or  less
  150.           specific.  
  151.  
  152.           Data  buffers  to be read or written currently don't need to
  153.           be in Chip memory.  This might change in the  future.    For
  154.           future  compatibility  and  with  the  trackdisk.device  you
  155.           should not depend on this.  
  156.  
  157.           In order to be able to format a  track  with  a  nonstandard
  158.           number of sectors (from 8 to 10), you must use the TD_FORMAT
  159.           command  with  less than 40 sectors (20480 bytes) at a time.
  160.           (If you whish to format tracks with less than 8 sectors, you
  161.           can only do this one track at a time.) Since you must always
  162.           format entire tracks at a time, this uniquely determines the
  163.           number of sectors you want  on  each  track.    The  current
  164.           number  of  sectors per track, which will be used later when
  165.           reading from the same disk, is updated accordingly.  If  you
  166.           specify  40  sectors  or  more,  messydisk.device  does  not
  167.           attempt to guess what you want but  simply  uses  the  value
  168.           that was  already set.  So, you may choose to first format a
  169.           single track to indicate the desired number of  sectors  per
  170.           track,  and  then  in one call format the entire rest of the
  171.           disk.  
  172.  
  173.           When a disk with more or less than 9 sectors  per  track  is
  174.           read,  you must first issue a CMD_READ command for the first
  175.           sector(s) of  the   disk.      When   track   0   is   read,
  176.           messydisk.device  determines how many sectors there are on a
  177.           track.  This number is then used afterwards when calculating
  178.           the tracks and sides of other sectors.   So,  this  is  very
  179.           important.  But for those (virtually impossible) cases where
  180.           not  all tracks have the same number of sectors, all sectors
  181.           (up to the maximum supported) that were read  on  any  track
  182.           will be written back.  Fortunately, all currently known file
  183.           systems  have  a  bootblock  at track 0, side 0, so they all
  184.           adapt transparently.  
  185.  
  186.      ›1mCAVEATS 
  187.           ›0mThe (outdated) TD_REMOVE command is routed to trackdisk.  As
  188.           a result of this, only one disk remove interrupt (per  unit)
  189.           may  be  installed  (with  this  command),  whether  through
  190.           trackdisk or messydisk.    (This  seems  to  have  been  the
  191.           original   intention   of  TD_REMOVE.)  Of  course,  current
  192.           programs should use TD_ADDCHANGEINT.  
  193.  
  194.  
  195.  
  196.  
  197.      Rhialto, KosmoSoft               -3-                 Version 34.8/1.30
  198.  
  199.  
  200.      messydisk.device()    Amiga Programmer's Manual     messydisk.device()
  201.  
  202.  
  203.      ›1mUTILITIES 
  204.           ›0mA separate program called  Ignore  is  supplied,  which  may
  205.           suppress the CRC check in any currently open unit.  When the
  206.           unit is definitively closed and later reopened, ignoring CRC
  207.           mismatches again has its default value of No.  
  208.  
  209.           Usage: ignore <unitnr> <YES/NO>
  210.  
  211.           If  you only give the unit number, ignore will output either
  212.           Yes or No, reflecting whether CRC mismatches  currently  are
  213.           ignored.  
  214.  
  215.           This  program  can  be  useful when you wish to recover data
  216.           from a damaged or marginal disk.  Sometimes text  files  may
  217.           be usable even if there are a few errors in them.  
  218.  
  219.      ›1mAUTHORS 
  220.           ›0mMessydisk  is written by ›3mSourcerer ›0mOlaf ›3mRhialto ›0mSeibert. The
  221.           low-level  writing  part  was  originally  done  by   Werner
  222.           Günther. Used with permission.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.      Rhialto, KosmoSoft               -4-                 Version 34.8/1.30
  264.  
  265.